package com.cncf.controller.user;

import com.cncf.entity.InvalidReportFile;
import com.cncf.response.ResponseData;
import com.cncf.service.InvalidReportFileService;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * @author zj
 */
@Api(value = "User", description = "用户端检验报告原件作废信息的相关接口")
@Controller
@RequestMapping("/user/invalidReportFile")
public class UserInvalidReportFileController {
    private static final Logger logger = LoggerFactory.getLogger(UserInvalidReportFileController.class);

    @Autowired
    private InvalidReportFileService invalidReportFileService;

    @ApiOperation(value = "获取所有的检验报告原件作废信息", notes = "不提供page和pageSize就不分页")
    @RequestMapping(value = "getAllInvalidReportFile", method = {RequestMethod.GET})
    @ResponseBody
    public ResponseData<List<InvalidReportFile>> getAllInvalidReportFile(
            @ApiParam("page") @RequestParam(value = "page", required = false) Integer page,
            @ApiParam("pageSize") @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        ResponseData<List<InvalidReportFile>> responseData = new ResponseData<>();
        List<InvalidReportFile> list = invalidReportFileService.getAllInvalidReportFile(page, pageSize);
        responseData.jsonFill(1, null, list);
        responseData.setCount(list.size());
        return responseData;
    }

}
